package com.wy.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class RedisUtil {
    @Autowired
    private RedisTemplate redisTemplate;

    public void save(String key,String value){
        redisTemplate.boundValueOps(key).set(value);
    }

    public String get(String key){
        return (String) redisTemplate.boundValueOps(key).get();
    }
}
